﻿@using AfrikDotnetWebSite.Models;
@using AfrikDotnetWebSite.Helpers;
@{
    ViewBag.Title = "Afrik.NET { Share; Learn; Build; Together; }";
    ViewBag.IsHomePage = true;
}

<div class="home cf">
    <div class="large-pane float-left">
        @if (ViewBag.Shows != null && (ViewBag.Shows as IEnumerable<Show>).Count() > 0)
        {
            <div id="ftHolder">
                @foreach (var show in ViewBag.Shows)
                { 
                    <img src="~/static/img/shows/@show.Image" alt="@show.Label" style="display:none" />
                    <a href="@show.Link"></a>    
                }
            </div>
        }
        <div class="news">
            <h2>News</h2>
            @if (ViewBag.News != null && (ViewBag.News as IEnumerable<News>).Count() > 0)
            {
                <ul>
                    @foreach (var news in ViewBag.News)
                    { 
                       <li>
                            <div>
                                <div class="text">@Html.Raw(LinkHelper.MakeLink(news.Text))</div>
                                <div class="date">
                                    @news.Date.ToString("dddd, dd MMMM yyyy '-' HH':'mm 'UTC'") 
                                </div>
                            </div>
                        </li>
                    }
                </ul>
            }
            else
            { 
                <div class="empty">No news</div>
            }
            @Html.ActionLink("All news", "index", "news", null, new { @class = "all" })
        </div>
    </div>
    <div class="small-pane float-right">
        @Html.Partial("_SidePane")
    </div>
</div>